package com.enjoyor.soa.traffic.rest.tsms.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONArray;
import com.enjoyor.soa.traffic.api.dto.tsms.TaskDetailInfoDto;
import com.enjoyor.soa.traffic.api.dto.tsms.TaskInfoDto;
import com.enjoyor.soa.traffic.frame.annotation.Auth;
import com.enjoyor.soa.traffic.frame.security.bean.dto.UserDto;
import com.enjoyor.soa.traffic.rest.tsms.dubbo.ITaskInfoConsumeService;
import com.enjoyor.soa.traffic.util.pojo.Page;
import com.enjoyor.soa.traffic.util.pojo.ResultPojo;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Auth
@RestController
@RequestMapping({ "/task" })
@Api("任务相关接口")
@CrossOrigin
public class TaskInfoController {


    @Autowired
    private ITaskInfoConsumeService taskInfoConsumeService;

    @GetMapping(value = { "/selectTaskInfoById" }, produces = { "application/json; charset=UTF-8" })
    @ResponseBody
    @ApiOperation("根据taskId查询任务信息")
    @ApiImplicitParam(name = "taskId", value = "任务编号", paramType = "query", required = true, dataType = "String")
    public ResultPojo selectTaskInfoById(
    		@RequestParam(defaultValue = "", value="taskId", required=true) String taskId, 
    		HttpServletRequest request) {
        return taskInfoConsumeService.selectTaskInfoById(taskId);
    }
    
	@GetMapping(value = { "/selectTaskInfoList" }, produces = { "application/json; charset=UTF-8" })
	@ResponseBody
	@ApiResponse(response=TaskInfoDto.class, code = 0, message = "")
    @ApiOperation("任务列表信息查询")
	@ApiImplicitParams({
    	@ApiImplicitParam(name = "taskId", value = "任务编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskName", value = "任务名称", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "schemeId", value = "方案编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskRankId", value = "任务等级编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskTypeId", value = "任务类型编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskBeginTime", value = "任务开始时间", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "taskEndTime", value = "任务结束时间", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "startPlace", value = "起始位置", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "targetPlace", value = "终点位置", paramType = "query", dataType = "String")  })
	public ResultPojo selectTaskInfoList(
			@RequestParam(defaultValue = "",value="taskId",required=false) String taskId,
			@RequestParam(defaultValue = "",value="taskName",required=false) String taskName,
			@RequestParam(defaultValue = "",value="schemeId",required=false) String schemeId,
			@RequestParam(defaultValue = "",value="taskRankId",required=false) String taskRankId,
			@RequestParam(defaultValue = "",value="taskTypeId",required=false) String taskTypeId,
			@RequestParam(defaultValue = "",value="taskBeginTime",required=false) String taskBeginTime,
			@RequestParam(defaultValue = "",value="taskEndTime",required=false) String taskEndTime,
			@RequestParam(defaultValue = "",value="startPlace",required=false) String startPlace,
			@RequestParam(defaultValue = "",value="targetPlace",required=false) String targetPlace,
			/*@RequestParam(value="startTime",required=false) Date startTime,*/
			HttpServletRequest request) {
		return taskInfoConsumeService.selectTaskInfoList(taskId, taskName, schemeId,
	    		taskRankId, taskTypeId, taskBeginTime, taskEndTime, startPlace, targetPlace);
	}
	
    @SuppressWarnings({ "rawtypes" })
    @GetMapping(value = { "/selectTaskInfoPage" }, produces = { "application/json; charset=UTF-8" })
    @ResponseBody
    @ApiOperation("任务分页信息查询")
    @ApiImplicitParams({
    	@ApiImplicitParam(name = "taskId", value = "任务编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskName", value = "任务名称", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "schemeId", value = "方案编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskRankId", value = "任务等级编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskTypeId", value = "任务类型编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskBeginTime", value = "任务开始时间", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "taskEndTime", value = "任务结束时间", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "startPlace", value = "起始位置", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "targetPlace", value = "终点位置", paramType = "query", dataType = "String")  })
    public ResultPojo selectTaskInfoPage(
    		@RequestParam(defaultValue = "",value="taskId",required=false) String taskId,
			@RequestParam(defaultValue = "",value="taskName",required=false) String taskName,
			@RequestParam(defaultValue = "",value="schemeId",required=false) String schemeId,
			@RequestParam(defaultValue = "",value="taskRankId",required=false) String taskRankId,
			@RequestParam(defaultValue = "",value="taskTypeId",required=false) String taskTypeId,
			@RequestParam(defaultValue = "",value="taskBeginTime",required=false) String taskBeginTime,
			@RequestParam(defaultValue = "",value="taskEndTime",required=false) String taskEndTime,
			@RequestParam(defaultValue = "",value="startPlace",required=false) String startPlace,
			@RequestParam(defaultValue = "",value="targetPlace",required=false) String targetPlace,
    		Page page, HttpServletRequest request) {
        return taskInfoConsumeService.selectTaskInfoPage(page, taskId, taskName, schemeId,
        		taskRankId, taskTypeId, taskBeginTime, taskEndTime, startPlace, targetPlace);
    }

    @GetMapping(value = { "/selectTaskExecuteInfoById" }, produces = { "application/json; charset=UTF-8" })
    @ResponseBody
    @ApiOperation("根据executeTaskId查询执行任务信息")
    @ApiImplicitParam(name = "executeTaskId", value = "执行任务编号", paramType = "query", required = true, dataType = "String")
    public ResultPojo selectTaskExecuteInfoById(
    		@RequestParam(defaultValue = "", value="executeTaskId", required=true) String executeTaskId, 
    		HttpServletRequest request) {
        return taskInfoConsumeService.selectExecuteTaskInfoById(executeTaskId);
    }
    
	@GetMapping(value = { "/selectExecuteTaskBaseInfoList" }, produces = { "application/json; charset=UTF-8" })
	@ResponseBody
	@ApiResponse(response=TaskDetailInfoDto.class, code = 0, message = "")
    @ApiOperation("执行任务列表信息查询")
	@ApiImplicitParams({
    	@ApiImplicitParam(name = "executeTaskId", value = "执行任务编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskId", value = "任务编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskName", value = "任务名称", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "schemeId", value = "方案编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskRankId", value = "等级编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskTypeId", value = "任务类型编号", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "beforeLicensePlate", value = "前导车牌", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "executeDate", value = "执行日期", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "beginTime", value = "开始时间", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "startPlace", value = "起始位置", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "targetPlace", value = "终点位置", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "executeStatusId", value = "执行状态编号", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "isWaitExecute", value = "是否待执行", paramType = "query", dataType = "String")  })
	public ResultPojo selectExecuteTaskBaseInfoList(
			@RequestParam(defaultValue = "",value="executeTaskId",required=false) String executeTaskId,
			@RequestParam(defaultValue = "",value="taskId",required=false) String taskId,
			@RequestParam(defaultValue = "",value="taskName",required=false) String taskName,
			@RequestParam(defaultValue = "",value="schemeId",required=false) String schemeId,
			@RequestParam(defaultValue = "",value="taskRankId",required=false) String taskRankId,
			@RequestParam(defaultValue = "",value="taskTypeId",required=false) String taskTypeId,
			@RequestParam(defaultValue = "",value="beforeLicensePlate",required=false) String beforeLicensePlate,
			@RequestParam(defaultValue = "",value="executeDate",required=false) String executeDate,
			@RequestParam(defaultValue = "",value="beginTime",required=false) String beginTime,
			@RequestParam(defaultValue = "",value="endTime",required=false) String endTime,
			@RequestParam(defaultValue = "",value="startPlace",required=false) String startPlace,
			@RequestParam(defaultValue = "",value="targetPlace",required=false) String targetPlace,
			@RequestParam(defaultValue = "",value="executeStatusId",required=false) String executeStatusId,
			@RequestParam(defaultValue = "",value="isWaitExecute",required=false) String isWaitExecute,
			HttpServletRequest request) {
		return taskInfoConsumeService.selectExecuteTaskBaseInfoList(executeTaskId, taskId, taskName, schemeId,
				taskRankId, taskTypeId, beforeLicensePlate, executeDate, beginTime, endTime, startPlace, targetPlace,
				executeStatusId, isWaitExecute);
	}
	
	@GetMapping(value = { "/selectExecuteTaskDetailInfoList" }, produces = { "application/json; charset=UTF-8" })
	@ResponseBody
	@ApiResponse(response=TaskDetailInfoDto.class, code = 0, message = "")
    @ApiOperation("执行任务详细列表信息查询")
	@ApiImplicitParams({
    	@ApiImplicitParam(name = "executeTaskId", value = "执行任务编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskId", value = "任务编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskName", value = "任务名称", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "schemeId", value = "方案编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskRankId", value = "等级编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskTypeId", value = "任务类型编号", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "beforeLicensePlate", value = "前导车牌", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "executeDate", value = "执行日期", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "beginTime", value = "开始时间", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "startPlace", value = "起始位置", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "targetPlace", value = "终点位置", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "executeStatusId", value = "执行状态编号", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "isWaitExecute", value = "是否待执行", paramType = "query", dataType = "String")  })
	public ResultPojo selectExecuteTaskDetailInfoList(
			@RequestParam(defaultValue = "",value="executeTaskId",required=false) String executeTaskId,
			@RequestParam(defaultValue = "",value="taskId",required=false) String taskId,
			@RequestParam(defaultValue = "",value="taskName",required=false) String taskName,
			@RequestParam(defaultValue = "",value="schemeId",required=false) String schemeId,
			@RequestParam(defaultValue = "",value="taskRankId",required=false) String taskRankId,
			@RequestParam(defaultValue = "",value="taskTypeId",required=false) String taskTypeId,
			@RequestParam(defaultValue = "",value="beforeLicensePlate",required=false) String beforeLicensePlate,
			@RequestParam(defaultValue = "",value="executeDate",required=false) String executeDate,
			@RequestParam(defaultValue = "",value="beginTime",required=false) String beginTime,
			@RequestParam(defaultValue = "",value="endTime",required=false) String endTime,
			@RequestParam(defaultValue = "",value="startPlace",required=false) String startPlace,
			@RequestParam(defaultValue = "",value="targetPlace",required=false) String targetPlace,
			@RequestParam(defaultValue = "",value="executeStatusId",required=false) String executeStatusId,
			@RequestParam(defaultValue = "",value="isWaitExecute",required=false) String isWaitExecute,
			HttpServletRequest request) {
		return taskInfoConsumeService.selectExecuteTaskDetailInfoList(executeTaskId, taskId, taskName, schemeId,
				taskRankId, taskTypeId, beforeLicensePlate, executeDate, beginTime, endTime, startPlace, targetPlace,
				executeStatusId, isWaitExecute);
	}
	
    @SuppressWarnings({ "rawtypes" })
    @GetMapping(value = { "/selectExecuteTaskInfoPage" }, produces = { "application/json; charset=UTF-8" })
    @ResponseBody
    @ApiOperation("执行任务分页信息查询")
    @ApiImplicitParams({
    	@ApiImplicitParam(name = "executeTaskId", value = "执行任务编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskId", value = "任务编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskName", value = "任务名称", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "schemeId", value = "方案编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskRankId", value = "等级编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskTypeId", value = "任务类型编号", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "beforeLicensePlate", value = "前导车牌", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "executeDate", value = "执行日期", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "beginTime", value = "开始时间", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "startPlace", value = "起始位置", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "targetPlace", value = "终点位置", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "executeStatusId", value = "执行状态编号", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "isWaitExecute", value = "是否待执行", paramType = "query", dataType = "String")  })
	public ResultPojo selectExecuteTaskInfoPage(
			@RequestParam(defaultValue = "",value="executeTaskId",required=false) String executeTaskId,
			@RequestParam(defaultValue = "",value="taskId",required=false) String taskId,
			@RequestParam(defaultValue = "",value="taskName",required=false) String taskName,
			@RequestParam(defaultValue = "",value="schemeId",required=false) String schemeId,
			@RequestParam(defaultValue = "",value="taskRankId",required=false) String taskRankId,
			@RequestParam(defaultValue = "",value="taskTypeId",required=false) String taskTypeId,
			@RequestParam(defaultValue = "",value="beforeLicensePlate",required=false) String beforeLicensePlate,
			@RequestParam(defaultValue = "",value="executeDate",required=false) String executeDate,
			@RequestParam(defaultValue = "",value="beginTime",required=false) String beginTime,
			@RequestParam(defaultValue = "",value="endTime",required=false) String endTime,
			@RequestParam(defaultValue = "",value="startPlace",required=false) String startPlace,
			@RequestParam(defaultValue = "",value="targetPlace",required=false) String targetPlace,
			@RequestParam(defaultValue = "",value="executeStatusId",required=false) String executeStatusId,
			@RequestParam(defaultValue = "",value="isWaitExecute",required=false) String isWaitExecute,
    		Page page, HttpServletRequest request) {
		return taskInfoConsumeService.selectExecuteTaskInfoPage(page, executeTaskId, taskId, taskName, schemeId,
				taskRankId, taskTypeId, beforeLicensePlate, executeDate, beginTime, endTime, startPlace, targetPlace,
				executeStatusId, isWaitExecute);
	}
    
    @PostMapping(value = { "/addTaskInfo" }, consumes = { "application/json; charset=UTF-8" }, produces = {
            "application/json; charset=UTF-8" })
    @ResponseBody
    @ApiOperation("新增警卫任务信息")
    public ResultPojo addTaskInfo(@RequestBody TaskInfoDto taskInfoDto, HttpServletRequest request) {
        return taskInfoConsumeService.insertTaskInfo(taskInfoDto,
                ((UserDto) request.getAttribute("currentUser")).getPersonName());
    }

    @PutMapping(value = { "/editTaskInfo" }, consumes = { "application/json; charset=UTF-8" })
    @ResponseBody
    @ApiOperation("更新警卫任务信息")
    public ResultPojo editTaskInfo(@RequestBody TaskInfoDto taskInfoDto, HttpServletRequest request) {
        return taskInfoConsumeService.editTaskInfo(taskInfoDto,
                ((UserDto) request.getAttribute("currentUser")).getPersonName());
    }
    
    @PutMapping(value = { "/editTaskForBeforePlate" }, consumes = { "application/json; charset=UTF-8" })
    @ResponseBody
    @ApiOperation("更新任务的前导车牌信息")
    @ApiImplicitParams({
		@ApiImplicitParam(name = "taskId", value = "任务编号", paramType = "query", required=true, dataType = "String"),
		@ApiImplicitParam(name = "beforePlate", value = "前导车牌", paramType = "query", required=false, dataType = "String"),
		@ApiImplicitParam(name = "dutyVideoId", value = "前导车视频编号", paramType = "query", required=false, dataType = "String")})
    public ResultPojo editTaskForBeforePlate(
			@RequestParam(defaultValue = "", value="taskId", required=true) String taskId, String beforePlate, String dutyVideoId,
			HttpServletRequest request) {
    	TaskInfoDto taskInfoDto = new TaskInfoDto();
    	taskInfoDto.setTaskId(taskId);
    	taskInfoDto.setBeforeLicensePlate(beforePlate);
    	taskInfoDto.setDutyVideoId(dutyVideoId);
    	String personName = ((UserDto) request.getAttribute("currentUser")).getPersonName();
        return taskInfoConsumeService.editTaskBaseInfo(taskInfoDto, personName);
    }

    @DeleteMapping(value = { "/deleteTaskInfo" }, produces = { "application/json; charset=UTF-8" })
    @ResponseBody
    @ApiOperation("删除警卫任务信息")
    @ApiImplicitParam(name = "taskId", value = "任务编号", paramType = "query", required = true, dataType = "String")
    public ResultPojo deleteTaskInfo(
    		//@PathVariable("taskId") String taskId, 
    		@RequestParam(defaultValue = "",value="taskId", required=true) String taskId, 
    		HttpServletRequest request) {
        return taskInfoConsumeService.deleteTaskInfo(taskId, 
        		((UserDto) request.getAttribute("currentUser")).getPersonName());
    }
    
    @GetMapping(value = { "/selectFastTaskInfoList" }, produces = { "application/json; charset=UTF-8" })
	@ResponseBody
	@ApiResponse(response=TaskInfoDto.class, code = 0, message = "")
    @ApiOperation("快速特勤任务列表信息查询")
	@ApiImplicitParams({
    	@ApiImplicitParam(name = "taskId", value = "任务编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskName", value = "任务名称", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskRankId", value = "任务等级编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskBeginTime", value = "任务开始时间", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "taskEndTime", value = "任务结束时间", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "startPlace", value = "起始位置", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "targetPlace", value = "终点位置", paramType = "query", dataType = "String")  })
	public ResultPojo selectFastTaskInfoList(
			@RequestParam(defaultValue = "",value="taskId",required=false) String taskId,
			@RequestParam(defaultValue = "",value="taskName",required=false) String taskName,
			@RequestParam(defaultValue = "",value="taskRankId",required=false) String taskRankId,
			@RequestParam(defaultValue = "",value="taskBeginTime",required=false) String taskBeginTime,
			@RequestParam(defaultValue = "",value="taskEndTime",required=false) String taskEndTime,
			@RequestParam(defaultValue = "",value="startPlace",required=false) String startPlace,
			@RequestParam(defaultValue = "",value="targetPlace",required=false) String targetPlace,
			/*@RequestParam(value="startTime",required=false) Date startTime,*/
			HttpServletRequest request) {
    	//默认查询快速特勤类型的任务
    	String taskTypeId = "TASKTYPE02";
		return taskInfoConsumeService.selectTaskInfoList(taskId, taskName, null,
	    		taskRankId, taskTypeId, taskBeginTime, taskEndTime, startPlace, targetPlace);
	}
	
    @SuppressWarnings({ "rawtypes" })
    @GetMapping(value = { "/selectFastTaskInfoPage" }, produces = { "application/json; charset=UTF-8" })
    @ResponseBody
    @ApiOperation("快速特勤任务分页信息查询")
    @ApiImplicitParams({
    	@ApiImplicitParam(name = "taskId", value = "任务编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskName", value = "任务名称", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskRankId", value = "任务等级编号", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "taskBeginTime", value = "任务开始时间", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "taskEndTime", value = "任务结束时间", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "startPlace", value = "起始位置", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "targetPlace", value = "终点位置", paramType = "query", dataType = "String")  })
    public ResultPojo selectFastTaskInfoPage(
    		@RequestParam(defaultValue = "",value="taskId",required=false) String taskId,
			@RequestParam(defaultValue = "",value="taskName",required=false) String taskName,
			@RequestParam(defaultValue = "",value="taskRankId",required=false) String taskRankId,
			@RequestParam(defaultValue = "",value="taskBeginTime",required=false) String taskBeginTime,
			@RequestParam(defaultValue = "",value="taskEndTime",required=false) String taskEndTime,
			@RequestParam(defaultValue = "",value="startPlace",required=false) String startPlace,
			@RequestParam(defaultValue = "",value="targetPlace",required=false) String targetPlace,
    		Page page, HttpServletRequest request) {
    	//默认查询快速特勤类型的任务
    	String taskTypeId = "TASKTYPE02";
        return taskInfoConsumeService.selectTaskInfoPage(page, taskId, taskName, null,
        		taskRankId, taskTypeId, taskBeginTime, taskEndTime, startPlace, targetPlace);
    }
    
    @PostMapping(value = { "/addFastTaskInfo" }, consumes = { "application/json; charset=UTF-8" }, produces = {
	    "application/json; charset=UTF-8" })
	@ResponseBody
	@ApiOperation("新增快速特勤任务信息")
	public ResultPojo addFastTaskInfo(@RequestBody TaskInfoDto taskInfoDto, HttpServletRequest request) {
	return taskInfoConsumeService.insertFastTaskInfo(taskInfoDto,
	        ((UserDto) request.getAttribute("currentUser")).getPersonName());
	}
	
	@PutMapping(value = { "/editFastTaskInfo" }, consumes = { "application/json; charset=UTF-8" })
	@ResponseBody
	@ApiOperation("更新快速特勤任务信息")
	public ResultPojo editFastTaskInfo(@RequestBody TaskInfoDto taskInfoDto, HttpServletRequest request) {
	return taskInfoConsumeService.editFastTaskInfo(taskInfoDto,
	        ((UserDto) request.getAttribute("currentUser")).getPersonName());
	}
	
	@DeleteMapping(value = { "/deleteFastTaskInfo" }, produces = { "application/json; charset=UTF-8" })
	@ResponseBody
	@ApiOperation("删除快速特勤任务信息")
	@ApiImplicitParam(name = "taskId", value = "任务编号", paramType = "query", required = true, dataType = "String")
	public ResultPojo deleteFastTaskInfo(
		@RequestParam(defaultValue = "",value="taskId", required=true) String taskId, 
		HttpServletRequest request) {
	return taskInfoConsumeService.deleteFastTaskInfo(taskId, 
			((UserDto) request.getAttribute("currentUser")).getPersonName());
	}
    
    
    /*@GetMapping(value = { "/getTaskByTimeAndSchemeId" }, produces = { "application/json; charset=UTF-8" })
	@ResponseBody
	@ApiOperation("（预演） 查询规定时间范围的方案信息")
    @ApiImplicitParams({
    	@ApiImplicitParam(name = "date", value = "当前时间", paramType = "query", dataType = "String"),
    	@ApiImplicitParam(name = "schemeId", value = "方案编号", paramType = "query", dataType = "String")})
	public ResultPojo getPreviewSchemeList(@RequestParam(defaultValue = "",value="schemeId",required=false) String schemeId,
			@RequestParam(defaultValue = "",value="date",required=false) String date,HttpServletRequest request) {
		return taskInfoConsumeService.getTaskByTimeAndSchemeId(schemeId, date);
	}*/
}
